class LoadIngDeal {
	private context: Main;
	private loadingView: LoadingUINew;
	public constructor(context: Main) {
		this.context = context;

	}

	public startLoad() {
		var point = this
		var loadRes = new LoadRes(this);
		return loadRes.loadConfig().then(function () {
			// alert("配置文件加载完成");
			return loadRes.loadTheme();
		}).then(function () {
			return new LoadGroup().loadGroup()
		}).then(function () {
			point.loadingView = new LoadingUINew();
			point.loadingView.scaleX = 0.56;
			point.loadingView.scaleY = 0.56;
			point.context.stage.addChild(point.loadingView);
			//  alert("皮肤资源加载完成");
			return new PreloadGroup(point.loadingView).loadGroup()
		}).then(function () {
			// alert("预加载资源加载完成");
			return Promise.resolve();
		});
	}

	public completeLoad() {
		this.context.stage.removeChild(this.loadingView);
	}
}